local lufu = fk.CreateSkill{
  name = "sd__lufu",
}

lufu:addEffect(fk.AfterDying, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return data.who == target and target.hp > 0 and target ~= player and player:hasSkill(lufu.name)
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, { skill_name = lufu.name, prompt = "#lufu-invoke:" .. target.id })
  end,
  on_use = function(self, event, target, player, data)
    player.room:changeMaxHp(player, -1)
    if not player.dead then
      player.room:useVirtualCard("slash", nil, player, target, lufu.name)
    end
  end,
})

Fk:loadTranslationTable{
  ["sd__lufu"] = "戮俘",
  [":sd__lufu"] = "当一名角色脱离濒死状态后，你可以减1点体力上限，视为对其使用一张【杀】。",
  
  ["#lufu-invoke"] = "你是否对 %src 发动“戮俘”？",
  
  -- 语音台词
  ["$lufu1"] = "降者不杀，顽抗必诛！",
  ["$lufu2"] = "负隅顽抗，只有死路一条！",
}

return lufu